﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace testGridMap
{
  public static class EarthPoints
  {

    private static EarthPoint[,] points;
    private const double R2D = 180 / Math.PI;
    private const double D2R = Math.PI / 180;


    static EarthPoints()
    {
      double radLon;
      double radLat;

      points = new EarthPoint[360, 180];

      for (int lat = -90; lat < 90; lat++)
        for (int lon = -180; lon < 180; lon++)
        {
          radLon = Degrees2Radians(lon);
          radLat = Degrees2Radians(lat);

          points[lon, lat] = new EarthPoint();
          NormalVector n = new NormalVector();
          n.X = Math.Sin(lon);
          n.Y = Math.Cos(lon);
          n.Z = Math.Sin(lat);
          points[lon, lat].NormalVector = n;
        }
    }


    //public EarthPoint this[int latitude, int longtitude]
    //{
    //  get{ return points[latitude, longtitude];}
    //}




    private static double Radians2Degrees(double rad)
    {
      return (R2D * rad);
    }

    private static double Degrees2Radians(double deg)
    {
      return (D2R * deg);
    }
  }
}
